/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-05     LOJAM       the first version
 */
#ifndef APPLICATIONS_BLE_SMARTHOME_H_
#define APPLICATIONS_BLE_SMARTHOME_H_

#include "nimble/ble.h"
#include "modlog/modlog.h"
#include "console/console.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Smarthome configuration */
#define GATT_SMRTHM_UUID                        0x181C  // User Data 0x180D
#define GATT_SMRTHM_STATUS_UUID                 0x2A4D  // Report //0x2A37
#define GATT_SMRTHM_CTRL_UUID                   0x2A9F  // User Control Point //0x2A38
#define GATT_DEVICE_INFO_UUID                   0x180A
#define GATT_MANUFACTURER_NAME_UUID             0x2A29
#define GATT_MODEL_NUMBER_UUID                  0x2A24

typedef enum
{
    status_read_event_id,
    ctrl_write_event_id
}event_id_t;

typedef void (*gatt_svr_event_handle_t)(event_id_t, void *);

extern uint16_t smrthm_ctrl_handle;

int gatt_svr_init(void);
void reg_gatt_event_handle(gatt_svr_event_handle_t event_handle);

#ifdef __cplusplus
}
#endif


#endif /* APPLICATIONS_BLE_SMARTHOME_H_ */
